{{include file="../Common/head.html"}}
<div class="box">
	<form role="form" method="post">
		<div class="form-group">
			<label for="exampleInputEmail1">账号</label>
			<div class="input-group">
		      <div class="input-group-addon"><i class="glyphicon glyphicon-user"></i></div>
		      <input required="" name="username" class="form-control" type="text" placeholder="请输入用户名">
		    </div>
		</div>
		<div class="form-group">
			<label for="exampleInputPassword1">Password</label>
			<div class="input-group">
		      <div class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></div>
		      <input required="" name="password" class="form-control" type="password" placeholder="请输入密码">
		    </div>
		</div>
			<input type="text" name="yanzheng" id="" >
			<br />
			<span id="vcofe"></span>
			<br />
			<img src="index.php?m=Admin&c=Login&a=Config" alt="" class="imgCode">
				<br />
			<a href="javascript:;" class="imgA">
				看不清换一张
			</a>
			<br />
		<button type="submit" class="btn btn-default">Submit</button>
	</form>
	
</div>

</body>
		<script>
		$(function() {
			//获得验证码图片的地址
			var src = $('.imgCode').attr('src');
			//点击更换图片的地址
			$('.imgCode,.imgA').click(function() {
				$('.imgCode').attr('src', src + '&mt=' + Math.random());
			})
			$('input[name=yanzheng]').blur(function(){
				var user = $(this).val();
//				alert(user);
//				return false;
				$.ajax({
					url : 'index.php?m=Admin&c=Login&a=verifyCode',
					type:'post',
					data:{u:user},
					success:function(phpdata){
						if(phpdata == 1){
							$('#vcofe').html('<span style="color:red">验证码正确</span>');
							$('#reg').attr('disabled',false);
						}else{
							$('#vcofe').html('<span style="color:green">验证码错误</span>');
							$('#reg').attr('disabled',true);
						}
					}
				})
			})
	 	})

</script>
</html>